/**
 * 会员中心
 */
var app = getApp()
Page({
	data: {
		root:'',
		siteroot:app.setting.siteroot,
		att_url:app.setting.att_url,
		syscolor:app.setting.syscolor,
		isnodata:false,
		account:app.setting.account,
		pagetitle:'我的优惠券' + '-' + app.setting.title,
		bannerHeight: Math.ceil(290.0 / 750.0 * getApp().screenWidth)
	},
	onPullDownRefresh: function (){
		var the=this;
		var opt={};
		the.onLoad(opt);
		setTimeout(function(){
			wx.stopPullDownRefresh()
		},1000);
	},
	onLoad: function (options){
		var the = this;
		wx.setNavigationBarTitle({'title':the.data.pagetitle});
		app.util.get(app.access,function(pagedata){
			console.log('pagedata');console.log(pagedata);
			the.setData({
				pagedata:pagedata,
				loading:false
			});
		});
	},
	coupon:function(e){
		var the=this
		var data = e.currentTarget.dataset;
		app.util.get('/coupon.myindex/main/status='+data.status,function(res){
			the.setData({
				pagedata:res,
				loading:false
			});
		});
	},
	click:function(evt){
		//用户点击事件 data.func 为方法名，data.params 为调用参数！
		var data=evt.currentTarget.dataset;
		app.util[data.func](data.params);
	}
})